# for 循环
# 遍历列表
cart = ['name1', 'name2', 'name3', 'name4']
for item in cart:
    print(item)
# name1 name2 name3 name4

# 遍历计算总价
total = 0
price = [23, 43, 45, 56, 67, 45]
for item in price:
    total += item   # 23+43+45+56+67+45
print(total)
# 279
